package com.itheima.Day13;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.util.Scanner;

public class sendDemo1 {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds = new DatagramSocket();
        Scanner sc = new Scanner(System.in);
        while (true){
            String s =sc.nextLine();
            byte[] bytes = s.getBytes();
            InetAddress address = InetAddress.getByName("224.0.1.0");
            int prot = 10000;
            DatagramPacket dp = new DatagramPacket(bytes,bytes.length,address,prot);
            ds.send(dp);
            ds.close();
        }
    }
}